package com.huaxin.service.impl;


import com.huaxin.model.User;
import com.huaxin.persistence.UserMapper;
import com.huaxin.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;



    @Override
    public List<User> userList() {
        return userMapper.list(null,null,null,null,null,null,User.class);
    }

    @Override
    @Transactional
    public void addUser() {
        User user=new User();
        userMapper.insert(user);
    }

    @Override
    public User getUser(Integer id) {
        return userMapper.getUser(id);
    }
}
